package com.hatch.data {
	
	/**
	 * @author David Knape
	 */
	public class Padding {
		
		public var top:Number = 2;
		public var bottom:Number = 2;
		public var left:Number = 2;
		public var right:Number = 2;
		
		function Padding( t:Number=-1, r:Number=-1, b:Number=-1, l:Number=-1) {
			if(t==-1) return;
			else top=t;
			
			if(r==-1) { left=right=bottom=top; return; }
			else right=r;
			
			if(b==-1) { bottom=top; return; }
			else bottom=b;
			
			if(l==-1) { left=right; return; }
			else left=l; 
		}
		
		// top + bottom
		public function get height () : Number {
			return top+bottom;
		}
		
		// left + right
		public function get width () : Number {
			return left+right;
		}
		
		public function clone() : Padding {
			return new Padding( top, right, bottom, left );
		}
	}
}
